<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/


$api = app('Dingo\Api\Routing\Router');
$params = [
    'middleware'=>[
        'api.throttle',
        'bindings'//设置依赖注入
    ],
    'limit'=>60,
    'expires'=>1
];
$api->version('v1', $params  ,function ($api) {
    $api->group([ 'prefix' => 'permission'], function ($api) {
        $api->group(['middleware' => ['auth:admin']], function ($api) {
            //获取管理员信息
            $api->resource('role',"Modules\Permission\Http\Controllers\RoleController");
            $api->resource('permission',"Modules\Permission\Http\Controllers\PermissionController");
        });
        
       
    });
});